package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="system_article" )
public class SystemArticle extends BaseObject implements Serializable {
    private Long articleId;
    private Long articleCatId;
    private String articleTitle;
    private String articleContent;
    private byte showOn;
    private Long adminId;
    private String adminName;
    private String relativeGoods;
    private Long createTime;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getArticleId() {
        return this.articleId;
    }
    
    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }
    
    @Column(name="article_cat_id", nullable=false)
    public Long getArticleCatId() {
        return this.articleCatId;
    }
    
    public void setArticleCatId(Long articleCatId) {
        this.articleCatId = articleCatId;
    }
    
    @Column(name="article_title", nullable=false, length=200)
    public String getArticleTitle() {
        return this.articleTitle;
    }
    
    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }
    
    @Column(name="article_content", nullable=false)
    public String getArticleContent() {
        return this.articleContent;
    }
    
    public void setArticleContent(String articleContent) {
        this.articleContent = articleContent;
    }
    
    @Column(name="show_on", nullable=false)
    public byte getShowOn() {
        return this.showOn;
    }
    
    public void setShowOn(byte showOn) {
        this.showOn = showOn;
    }
    
    @Column(name="admin_id", nullable=false)
    public Long getAdminId() {
        return this.adminId;
    }
    
    public void setAdminId(Long adminId) {
        this.adminId = adminId;
    }
    
    @Column(name="admin_name", nullable=false, length=100)
    public String getAdminName() {
        return this.adminName;
    }
    
    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }
    
    @Column(name="relative_goods", nullable=false)
    public String getRelativeGoods() {
        return this.relativeGoods;
    }
    
    public void setRelativeGoods(String relativeGoods) {
        this.relativeGoods = relativeGoods;
    }
    
    @Column(name="create_time", nullable=false)
    public Long getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SystemArticle pojo = (SystemArticle) o;

        if (articleCatId != null ? !articleCatId.equals(pojo.articleCatId) : pojo.articleCatId != null) return false;
        if (articleTitle != null ? !articleTitle.equals(pojo.articleTitle) : pojo.articleTitle != null) return false;
        if (articleContent != null ? !articleContent.equals(pojo.articleContent) : pojo.articleContent != null) return false;
         if (adminId != null ? !adminId.equals(pojo.adminId) : pojo.adminId != null) return false;
        if (adminName != null ? !adminName.equals(pojo.adminName) : pojo.adminName != null) return false;
        if (relativeGoods != null ? !relativeGoods.equals(pojo.relativeGoods) : pojo.relativeGoods != null) return false;
        if (createTime != null ? !createTime.equals(pojo.createTime) : pojo.createTime != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (articleCatId != null ? articleCatId.hashCode() : 0);
        result = 31 * result + (articleTitle != null ? articleTitle.hashCode() : 0);
        result = 31 * result + (articleContent != null ? articleContent.hashCode() : 0);
         result = 31 * result + (adminId != null ? adminId.hashCode() : 0);
        result = 31 * result + (adminName != null ? adminName.hashCode() : 0);
        result = 31 * result + (relativeGoods != null ? relativeGoods.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("articleId").append("='").append(getArticleId()).append("', ");
        sb.append("articleCatId").append("='").append(getArticleCatId()).append("', ");
        sb.append("articleTitle").append("='").append(getArticleTitle()).append("', ");
        sb.append("articleContent").append("='").append(getArticleContent()).append("', ");
        sb.append("showOn").append("='").append(getShowOn()).append("', ");
        sb.append("adminId").append("='").append(getAdminId()).append("', ");
        sb.append("adminName").append("='").append(getAdminName()).append("', ");
        sb.append("relativeGoods").append("='").append(getRelativeGoods()).append("', ");
        sb.append("createTime").append("='").append(getCreateTime()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
